all:main  testkcpclient testkcpserver  check test2filesender test2filereceiver test3kcpsender test3kcpreceiver test4udprossender test4udprosreceiver test5tcprossender test5tcprosreceiver

test2:test2filesender test2filereceiver
test3:test3kcpsender test3kcpreceiver

home_dir=..
dependence_kcp=${home_dir}/kcp/Control.hpp ${home_dir}/kcp/ControlVeno.hpp ${home_dir}/kcp/Kcp.hpp ${home_dir}/kcp/KcpHdr.hpp

dependence_transport=${home_dir}/transport/transport.hpp ${home_dir}/transport/transport_udp.hpp ${home_dir}/transport/transport_kcp.hpp ${home_dir}/transport/transport_tcp.hpp 

dependenc_util=${home_dir}/util/datatypes.hpp ${home_dir}/util/header.hpp ${home_dir}/util/io.hpp ${home_dir}/util/poll_manager.hpp ${home_dir}/util/poll_set.hpp ${home_dir}/util/util.hpp ${home_dir}/util/ThreadPool.hpp ${home_dir}/util/Trace.hpp ${home_dir}/util/UdpSocket.hpp


dependence=${dependence_kcp} ${dependenc_util} ${dependence_transport} ${dependence_fec} common.h



lib=${lib_fec} -lpthread -lboost_system -lboost_thread 


main:main.cpp ${dependence}
	g++ -std=c++17 -g -o main main.cpp ${lib}
testkcpclient:testkcpclient.cpp ${dependence}
	g++ -std=c++17 -g -o testkcpclient testkcpclient.cpp ${lib} 
testkcpserver:testkcpserver.cpp ${dependence}
	g++ -std=c++17 -g -o testkcpserver testkcpserver.cpp ${lib}
test2filesender:test2filesender.cpp ${dependence}
	g++ -std=c++17 -g -o test2filesender test2filesender.cpp ${lib}
test2filereceiver:test2filereceiver.cpp ${dependence}
	g++ -std=c++17 -g -o test2filereceiver test2filereceiver.cpp ${lib}
test3kcpsender:test3kcpsender.cpp ${dependence}
	g++ -std=c++17 -g -o test3kcpsender test3kcpsender.cpp ${lib}
test3kcpreceiver:test3kcpreceiver.cpp ${dependence}
	g++ -std=c++17 -g -o test3kcpreceiver test3kcpreceiver.cpp ${lib}
test4udprossender:test4udprossender.cpp ${dependence}
	g++ -std=c++17 -g -o test4udprossender test4udprossender.cpp ${lib}
test4udprosreceiver:test4udprosreceiver.cpp ${dependence}
	g++ -std=c++17 -g -o test4udprosreceiver test4udprosreceiver.cpp ${lib}
test5tcprossender:test5tcprossender.cpp ${dependence}
	g++ -std=c++17 -g -o test5tcprossender test5tcprossender.cpp ${lib}
test5tcprosreceiver:test5tcprosreceiver.cpp ${dependence}
	g++ -std=c++17 -g -o test5tcprosreceiver test5tcprosreceiver.cpp ${lib}
check:check.cpp 
	g++ -std=c++17 -g -o check check.cpp 
clean:
	rm -f main testkcpclient testkcpserver test2filesender test2filereceiver test3kcpsender test3kcpreceiver test4udprossender test4udprosreceiver test5tcprossender test5tcprosreceiver
